class roleManage{
    constructor(){
        this.Menu = []
    }
    add(Menu){
        this.Menu.push(Menu)
    }
    scanf(){
        for(let i = 0 ; i < this.Menu.length;i++){
            this.Menu[i].scanf()
        }
    }
}
class oneMenu{
    constructor(name){
        this.name = name
        this.list = [] //子功能
    }
    add(Menu){
        this.list.push(Menu)
    }
    scanf(){
        console.log(this.name);
        for(let i = 0; i<this.list.length;i++){
            this.list[i].scanf()
        }
    }
}
class twoMenu{
    constructor(name){
        this.name = name
    }
    scanf(){
        console.log(`-${this.name}`);
    }
}
const mainMenu = new roleManage()
const onerole = new oneMenu('角色管理')
const onerole1 = new oneMenu('社区管理')
const tworole1 = new twoMenu('增加管理员')
const tworole2 = new twoMenu('删除管理员')
const tworole3 = new twoMenu('增加文章')
const tworole4 = new twoMenu('删除文章')
mainMenu.add(onerole)
mainMenu.add(onerole1)
onerole.add(tworole2)
onerole.add(tworole1)
onerole1.add(tworole3)
onerole1.add(tworole4)
mainMenu.scanf()



let a = [1,2,3]
let b = [1,2,3]
console.log(a.map(()=>performance.now()));
console.log(b.forEach(()=>{setTimeout(()=>{b.push( performance.now())},500)}));
console.log(b);
for(const i in b){
    b.push(performance.now())
}